package com.jie.netty.im.tactics.factory;

import com.jie.constants.ChannelAttrKey;
import com.jie.netty.im.tactics.DisconnectionHandler;
import com.jie.netty.im.tactics.impl.LoginDisconnectionHandler;
import com.jie.netty.im.tactics.impl.RoomDisconnectionHandler;

/**
 * 心跳消息结束工厂
 * @Author: 杰
 * @Project :net-disk
 * @DateTime: 2024/7/23 14:23
 **/
public class DisconnectionFactory {
    public static DisconnectionHandler createDisconnectionHandler(String type){
        DisconnectionHandler disconnectionHandler=null;
        switch (type){
            case ChannelAttrKey.LOGIN_INFO:
                disconnectionHandler=new LoginDisconnectionHandler();
                break;
            case ChannelAttrKey.ROOM_ID:
                disconnectionHandler=new RoomDisconnectionHandler();
                break;
            default:
                break;
        }
        return disconnectionHandler;
    }
}
